package com.example.abc.repository;

import com.example.abc.common.DataTableRequest;
import com.example.abc.dto.Profile;
import com.example.abc.entity.Account;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Mapper
public interface AccountDao {
    int insert(@Param("pojo") Account pojo);

    int insertSelective(@Param("pojo") Account pojo);

    int insertList(@Param("pojos") List<Account> pojo);

    int update(@Param("pojo") Account pojo);

    Account findByUsername(@Param("username")String username);

    List<Account> seach(@Param("req")DataTableRequest dataTableRequest,RowBounds rowBounds);

    Long seachCount(@Param("req")DataTableRequest dataTableRequest);

    Account findById(@Param("id")Long id);

    void updateAvatar(@Param("uid")String uid, @Param("avatar_url")String avatar_url);

    void updateProfile(@Param("pojo")Profile profile);

    Account findByUid(@Param("uid")String uid);
}
